<?php
/* @var $this ProductController */
/* @var $model Product */


$this->menu=array(
	array('label'=>'Журнал товаров', 'url'=>array('index')),
	array('label'=>'Создать товар', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#product-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Управление товарами</h1>


<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'product-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'id',
		'product_title',
		'price_g',
		'price_d',
		'description',
		'insight',
		'category_id',
		'subcategory_id',
		
		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>
<?php 
    echo Yii::app()->getBasePath().'/../images/upload/productImage/'.$image->imagename;
?>